<?php

class Form_ProjectForm extends Form_Custom_General {

    public function init() {

        $prj_id = $this->createElement('hidden', 'prj_id')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($prj_id);

        $prj_name = $this->createElement('text', 'prj_name')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($prj_name);

        $cus_id = $this->createElement('select', 'cus_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select customer.')));
        $this->addElement($cus_id);

        $cus_note = $this->createElement('text', 'cus_note')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Notes should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($cus_note);

        $dsg_id = $this->createElement('select', 'dsg_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select designer in charge.')));
        $this->addElement($dsg_id);

        $dsg_commision_type = $this->createElement('select', 'dsg_commision_type')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select designer commision type.')));
        $this->addElement($dsg_commision_type);

        $dsg_commision_percentage = $this->createElement('text', 'dsg_commision_percentage')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Percentage should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "15"));
        $this->addElement($dsg_commision_percentage);

        $dsg_commision = $this->createElement('text', 'dsg_commision')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Commision should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "30"));
        $this->addElement($dsg_commision);

        $prj_costprice = $this->createElement('text', 'prj_costprice')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Cost price should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "readonly" => true));
        $this->addElement($prj_costprice);
        
        
        $prj_totalday = $this->createElement('text', 'prj_totalday')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Total Day of project should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "readonly" => true));
        $this->addElement($prj_totalday);
        
        
        
        
        
        $prj_profit_loss_margin = $this->createElement('text', 'prj_profit_loss_margin')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Cost price should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "readonly" => true));
        $this->addElement($prj_profit_loss_margin);

        $prj_sellingprice = $this->createElement('text', 'prj_sellingprice')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Selling price should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "readonly" => true));
        $this->addElement($prj_sellingprice);
        
        
        $prj_specialdiscount = $this->createElement('text', 'prj_specialdiscount')
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Special Discount should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($prj_specialdiscount);
        
        $prj_renovationprice = $this->createElement('text', 'prj_renovationprice')
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Special Discount should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "readonly" => true));
        $this->addElement($prj_renovationprice);
        
        
        $prj_status = $this->createElement('select', 'prj_status')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select status.')));
        $this->addElement($prj_status);

        $submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes"));
        $this->addElement($submit);


        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit"));
        $this->addElement($reset);
    }

}